package com.meet.persist.dao;

import com.meet.persist.entity.ActivityParticipant;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface ActivityParticipantDao {
    List<ActivityParticipant> findByActivityId(String activityId);

    ActivityParticipant findByActivityAndUserId(@Param("activityId") String activityId, @Param("userId") String userId);

    boolean insert(ActivityParticipant participant);

    boolean delete(@Param("activityId") String activityId, @Param("userId") String userId);

    int countByActivityId(String activityId);

    /**
     * 检查用户是否已注册活动
     */
    boolean isRegistered(@Param("activityId") String activityId, @Param("userId") String userId);

    /**
     * 注册用户参加活动
     */
    boolean register(@Param("activityId") String activityId, @Param("userId") String userId);

    /**
     * 取消用户活动注册
     */
    boolean cancelRegistration(@Param("activityId") String activityId, @Param("userId") String userId);
}
